package com.example.canhui01li.myapprxretrofitdagger;

import android.os.Environment;

import com.lch.base.http.annotation.APIHeader;
import com.lch.base.http.annotation.APIIgnore;
import com.lch.base.http.annotation.APIMulti;
import com.lch.base.http.annotation.APIPath;
import com.lch.base.http.model.params.BaseJsonParam;

import java.io.File;

/**
 * @author lee
 * @version 1.0 on 17/12/9.
 */

public class TestPostMultiParams extends BaseJsonParam {

    public String UserAgent = "asdf";

    //-------头部请求参数
    @APIHeader
    public String headerInt = "123321";

    @APIHeader
    public String headerString = "VVQQ水电费QQVV";

    @APIHeader
    public boolean headerBoolean = false;

    public String account = "123@qq.com";
    public String password = "123456";


    //---url替换参数
    @APIPath
    public String urlPath = "urlPathRepelce";

    @APIPath
    public String urlchange = "123cccc";

    //---url替换参数
    @APIIgnore
    public String goneParmas = "我是不显示的参数";

    @APIMulti
    public String bodyParmas = "22bodyParmas";

    @APIMulti
    public File bodyFile = new File(getSDPath() + "/hs_user.txt");

    @APIMulti
    byte[] mBytes = new String("11111111111").getBytes();

    public String getSDPath(){
        File sdDir = null;
        boolean sdCardExist = Environment.getExternalStorageState()
                .equals(android.os.Environment.MEDIA_MOUNTED);//判断sd卡是否存在
        if(sdCardExist)
        {
            sdDir = Environment.getExternalStorageDirectory();//获取跟目录
        }
        return sdDir.toString();
    }
}
